<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
<base href="<%=basePath%>"/>
<title>soda教育</title>
<link href="qiantai/css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="qiantai/js/banner1.js"></script>
<script type="text/javascript">
function sel(ck) {

		var was = document.getElementsByName("checkbox2");
		for (var int = 0; int < was.length; int++) {
			was[int].checked = ck.checked;
		}

	}
	function sele(ck) {
		var ws = document.getElementById("checkbox1");
		if (ck.checked == false) {
			ws.checked = "";
		}
		var was = document.getElementsByName("checkbox2");

		for (var int = 0; int < was.length; int++) {
			if (was[int].checked == false) {
				return;
			}
		}
		ws.checked = true;

	}
	function baoname() {
		var nids = document.getElementsByName("checkbox2");
		
		var ids = [];
		for ( var i in nids) {
			if (nids[i].checked) {
				ids.push(nids[i].value);
			}			
		}
		location.href = "ShowQIanTaiServletHan?ids=" + ids+"&met=baoming";
	}
	function ckbuy() {
		var als = document.getElementsByName("checkbox2");
		for (var i = 0; i < als.length; i++) {
			if (als[i].checked == true) {

				return true;
			}
		}
		alert("您还没有选您想报名的课程，请选择！");
		return false;
	}
	function ckxuan() {
	
			var nids = document.getElementsByName("checkbox2");
			var Array = [];
			if (ckbuy()) {
				for (var i = 0; i < nids.length; i++) {
					if (nids[i].checked) {
						Array.push(nids[i].value);
					}
				}
				location.href = "ShowQianTaiServletYu?meet=goumai&Array="+Array;
			}
				
	}
</script>
<link href="qiantai/css/single.css" type="text/css" rel="stylesheet" />
</head>

<body>
<iframe style="width:100%;height:236px" scrolling="no" frameborder="0" src="qiantai/header.jsp"></iframe>
<div class="content">
   
   <div class="clear"></div>
   <div class="buyDiv">
   <form action="ShowQIanTaiServletHan?met=baoming" method="post">
   	<div class="buyHeader">
   		<h1>现场授课报名</h1>
        <div class="innerDiv" onclick="history.back();">返 回</div>
   		<div class="innerDiv" onclick="ckxuan();">报 名</div>
   	</div>
   
   
   	<div class="buyBody">
   	
    	<table class="buyTable"  cellpadding="0" cellspacing="0"> 

            <tr>
            	<th><input type="checkbox" name="checkbox1"
								id="checkbox1" onclick="sel(this)" /></th>
                <th>课程名称</th>
                <th>课程讲师</th>
                <th>课程价格</th>
                <th>课程类型</th>
                <th>开课时间</th>
                <th>结课时间</th>
                <th>课程简介</th>
            </tr>
            <c:forEach items="${names}" var="cou">
				<tr>
					<td><input type="checkbox" name="checkbox2" onclick="sele(this)"value="${cou.couId }"  /></td>
					<td><a href="ShowQIanTaiServletHan?met=xiangxi&couid=${cou.couId}">${cou.couName}</a></td>
					<td>${cou.user.useName}</td>
					<td>${cou.couMoney}</td>
					<td>现场教学</td>
					<td>${cou.couOpentime}</td>
					<td>${cou.couEndtime}</td>
					<td><p>${cou.couRemark}</p></td>
				</tr>
			</c:forEach>
        </table>
        </form>
    </div>
   	
    <div class="buyFoot">
   
		<div class="pageDiv">
		 <c:if test="${page.page!=1 }">
			<a href="ShowQianTaiServletYu?meet=course&couName=${nam}&couname=${couname }&page=1&couType=1">首页</a>&nbsp;&nbsp;
			</c:if>
			<a href="ShowQianTaiServletYu?meet=course&couName=${nam}&couname=${couname }&page=${page.page -1}&couType=1">上一页</a>&nbsp;&nbsp;
			<a href="ShowQianTaiServletYu?meet=course&couName=${nam}&couname=${couname }&page=${page.page+1 }&couType=1">下一页</a>&nbsp;&nbsp;
			 <c:if test="${page.page!=page.lastPage }">
			<a href="ShowQianTaiServletYu?meet=course&couName=${nam}&couname=${couname }&page=${page.lastPage }&couType=1">尾页</a>
			</c:if>
			<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				共${page.total }条数据 &nbsp;&nbsp; 当前第&nbsp;&nbsp;${page.page }&nbsp;&nbsp;页
				共&nbsp;${page.lastPage }&nbsp;页</span>
		</div>
    </div>
   
   </div>
   <div class="clear"></div><!--清除浮动-->
</div><!--content end-->
<div class="footer">
   <ul>  
       <li class="li_left">地址：北京海淀区成府路**号</li>
       <li class="li_right">联系电话：010-82365636</li>
   </ul>
</div><!--footer end-->
<div style="display:none"><script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script></div>
</body>
</html>